vcWorld
World is the root node of the simulation. It provides access to the layout items, components, groups and views.
See in: Overview
Module: vcCore
Parent: vcLayout
Children -
Referenced by: vcBehavior.World, vcCore.getWorld(), vcNode.World, vcWorldManager.ActiveWorld, ... (see more)
vcBehavior.World
vcCore.getWorld()
vcNode.World
vcWorldManager.ActiveWorld
vcWorldManager.StaticDrawingWorld
vcWorldManager.StaticSimWorld
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Behaviors | vcList[vcBehavior] | R | Gets a list of all behaviors in the world. |
| CollisionManager | vcCollisionManager | R | Gets collision manager instance that is used to listen to collision events from existing collision detectors in this vcWorld. |
| Components | vcObservableList[vcComponent] | R | Gets a list of all components in the 3D world. |
| FocusModeManager | vcFocusModeManager | R | Gets focus mode manager instance that is used to control focus mode feature for this vcWorld. |
| LayoutItems | vcList[vcLayoutItem] | R | Gets a list of all layout items in the current layout. |
| LayoutModified | Boolean | RW | Gets or sets if the current layout has been modified since it was loaded or its last save.See moreLayoutModified acts as a flag for determining if you are prompted to save a layout and the current state of the Save command. The value is set to True when a user makes a change to the current layout using the GUI. A script that makes changes to a layout should set the value to True in order for the application to know whether or not the layout needs to be saved.This is not needed if the script only makes temporary changes to a layout during a simulation. |
| LayoutUri | String | R | Gets the URI of current layout. |
| Layouts | vcList[vcLayout] | R | Gets a list of all layouts in the world. |
| Lights | vcList[vcLight] | R | Gets a list of all lights in the 3D world. |
| ProcessController | vcProcessController | R | Gets the process controller. |
| StatisticsManager | vcStatisticsManager | R | Gets the statistics manager of simulation used for defining intervals for all statistics behaviors. |
| Views | vcList[vcView] | R | Gets a list of all views in the current layout. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| clear | None | None | Removes all components from the 3D world.See moreExceptions: RuntimeError: When called from a script that is not python command. RuntimeError: When world's hierarchy is locked. |
| connectComponents | Boolean | vcComponent fromComponent, vcComponent toComponent | Connects all matching physical interfaces between two given components.See moreIf a physical connection requires repositioning then toComponent is snapped to fromComponent. If a connection forms a parent-child hierarchy, the child component is moved and attached to the parent component. Parameters: fromComponent (vcComponent): Component to connect from. toComponent (vcComponent): Component to connect to. Returns: bool: True when matching interfaces were found in the components. True doesn't necessarily mean that any interfaces got connected. |
| createBehavior | None | None | Adding behaviors to the world root node is not supported.. Exceptions: RuntimeError: Always. |
| createComponent | vcComponent | Optional Keyword[name = String] | Creates a new component at the 3D world origin.See moreParameters: Optional: name (str): Name for the new component. When not provided, an auto-generated name will be given. Exceptions: ValueError: When given component name is not unique. Returns: vcComponent: The newly created component. |
| createLayoutItem | vcLayoutItem | vcLayoutItemType type | Creates a new layout item of a given type in the current layout.See moreParameters: type (str): item type to create Returns: vcLayoutItem: The newly created layout item. Exceptions: RuntimeError: When specific value type does not exists. RuntimeError: When trying to create annotation, dimension or drawing item without license for Drawing API. |
| createLight | vcLight | vcLightType type | Creates a new light with a given type which is attached to the 3D world.See moreParameters: type (vcLightType): Light type. Returns: vcLight: Light. |
| createView | vcView | String name | Creates a new view of a given name based on the current 3D world view.See moreThe view itself is saved with a layout and listed as a User View in the GUI whenever the layout is loaded in the 3D world. Parameters: name (str): View name. Returns: vcView: View. |
| createVolumeDetector | vcVolumeDetector | None | Creates a new volume detector into this world. Returns: vcVolumeDetector: Created volume detector. |
| delete | None | None | Deletes world nodeSee moreExceptions: RuntimeError: When Parent node is null. RuntimeError: When world node is a system world. RuntimeError: When there is no license for Modeling API. |
| deleteView | None | vcView view | Deletes the provided view from the current layout. Parameters: view (vcView): View. |
| findCamera | vcCamera | Optional Keyword[name = String] | Returns a camera used by the application in an environment.See moreAn optional name argument can be given to find a specific camera; otherwise the method returns the first found camera. If no camera is found, returns None. Parameters: Optional: name (str): Camera name. Returns: vcCamera: Camera. |
| findComponent | vcComponent | String name | Finds the component matching a given name.See moreParameters: name (str): Component's name. Returns: vcComponent: Returns the found component. If no match is found, returns None. |
| findLayoutItem | vcLayoutItem | Optional Keyword[name = String] | Returns a layout item that matches a given name in current layout.See moreParameters: name (str): item type to name Returns: vcLayoutItem: The found layout item. If nothing was found, returns None. |
| findLight | vcLight | Optional Keyword[name = String] | Returns the first found light in the 3D world or a light matching a given name.See moreIf no light is found with the given name, returns None. Parameters: Optional: name (str): Light name. Returns: vcLight: Light. |
| findView | vcView | String name | Returns a view matching a given name in the current layout; otherwise returns None. Parameters: name (str): View name. Returns: vcView: View. |
| getFeature | None | None | Features directly on the 3D world are not supported. Returns: None. |
| useView | None | vcView view, Optional Keyword[time = Real] | Switches the view of the 3D world to the provided view. An optional time argument can be given to interpolate the linear movement of the camera to new view. That is, a timed camera movement (in seconds). See moreParameters: view (vcView): View. Optional: time (float): Interpolation time in seconds. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnDynamicComponent | None | Triggered when a component is created in 3D world during a simulation.See moreFor static components, use the events from the list you get from the property Components. Parameters: component(vcComponent) : The component that was added or removed. added(bool) : True if the component was added, false if it was removed. |
Example: Find Component From World
"""Finding a component is done via vcWorld in py3 api. This example shows how to find a component by its name in the world. """ import vcCore as vc world = vc.getWorld() found_comp = world.findComponent("MyCustomComponent") print (found_comp.Name)